package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Work;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;

@Mapper
public interface WorkMapper extends BaseMapper<Work>{

//    // 自定义的关键词搜索方法
//    @Select("<script>"
//            + "SELECT * FROM generic_demo "
//            + "WHERE 1=1 "
//            + "<if test='keyword != null and keyword != \"\"'>"
//            + "AND (user_name LIKE CONCAT('%', #{keyword}, '%') "
//            + "OR applicant LIKE CONCAT('%', #{keyword}, '%')) "
//            + "</if>"
//            + "</script>")
//    List<SysUser> searchByKeyword(@Param("keyword") String keyword);

//    // 更新 status 的方法
//    @Update("UPDATE generic_demo SET approval_status = #{approval_status} WHERE id = #{id}")
//    int updateStatus(@Param("id") int id, @Param("approval_status") String approval_status);

}
